<?php
/**
 * Helper for flash messages.
 *
 * @category Zend
 * @package Flash
 * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc.
 * @version $Id$
 * @link http://framework.zend.com
 * @since Available since release 1.0
 */

class Disputeo_Controller_Action_Helper_Flash extends Zend_Controller_Action_Helper_Abstract
{
    /**
     * @var Zend_Controller_Action_Helper_Abstract
     */
    protected $_flash;
    
    /**
     * Initialise flash messenger property
     */
    public function __construct()
    {
        $this->_flash = Zend_Controller_Action_HelperBroker::getStaticHelper('FlashMessenger');
    }
    
    /**
     * Call helper as broker method
     * 
     * @param type $name
     * @param type $options
     */
    public function direct($name, $options = null)
    {
        $messages = $this->_flash->getMessages();
        
        return in_array($name, $messages);
    }
}
